package saveData;

import model.ApiDataModel;
import model.TestResultAnalysisModel;

import java.io.*;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * Created by yangxianming on 2015-06-24.
 */
public class CreateDir{
    static public String createDirPart(){
//        创建日志目录
        Date date = new Date();
        DateFormat format2 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String yyyymmddhhmmss = format2.format(date);
        yyyymmddhhmmss = yyyymmddhhmmss.replaceAll(" |:", "-");
        String resultFilePath = System.getProperty("user.dir") + "/testResult/"  + yyyymmddhhmmss;
//        创建目录
        File file1 = new File(resultFilePath);
        file1.mkdirs();

//        创建 失败日志
        File fileFailed = new File(resultFilePath + "/failedApi");
        if (!fileFailed.exists()){
            try {
                fileFailed.createNewFile();
            }catch (IOException e){
                e.printStackTrace();
            }
        }

//        返回时间字符串
        return resultFilePath;
    }
}
